<?php
// Updating user session
if (isset($_SESSION[ "ser_user" ])) {
	$user=unserialize($_SESSION[ "ser_user" ]);
	//If the domain sent doesn't match the actual one we log off the user 
	if (!$server->my_site[0]->is_host($user->site_domain)) {
		$user= new user();
		$user->init_defaults($server->my_site[0]->subdomain . '.' . $server->my_site[0]->domain);
	}
}
else {
	$user= new user();
	#We load the default data when a new user comes to the site
	$user->init_defaults($server->my_site[0]->subdomain . '.' . $server->my_site[0]->domain);
}
$_SESSION["ser_user"]=serialize($user);
?>